import http from '@/utils/request.js';

// 报障 小区列表
export const listBuilding = (data) => {
	// return http.get('/repair/building/listBuilding', data);
	return http.request({
		url: '/repair/building/listBuilding',
		method: 'get',
		data
	});
};
// 报障 电梯列表
export const listElevator = (data) => {
	// return http.get('/repair/maintain/elevator/listElevator', data);
	return http.request({
		url: '/repair/maintain/elevator/listElevator',
		method: 'get',
		data
	});
};
// 报障 指派人列表
export const getAssignMemberList = (data) => {
	// return http.get('/blade-user/getAssignMemberList', data);
	return http.request({
		url: '/blade-user/getAssignMemberList',
		method: 'get',
		data
	});
};
// 报障内容
export const malfunctionWorkSave = (data) => {
	// return http.post('/repair/maintain/malfunction/work/malfunctionWorkSave', data, true);
	return http.request({
		url: '/repair/maintain/malfunction/work/malfunctionWorkSave',
		method: 'post',
		data,
		textJson: true,
	});
};

// 获取小组关联的小区与电梯
export const getElevatorList = (data) => {
	// return http.post('/repair/building/myMaintainBuilding', data, true);
	return http.request({
		url: '/repair/building/myMaintainBuilding',
		method: 'post',
		data,
		textJson: true,
	});
};
// 获取我的项目电梯(我的电梯入口)
export const getElevatorListChild = (data) => {
	// return http.post('/repair/building/myMaintainBuildingChild', data, true);
	return http.request({
		url: '/repair/building/myMaintainBuildingChild',
		method: 'post',
		data,
		textJson: true,
	});
};
// 获取我的项目电梯(报障入口)
export const getElevatorListChilds = (data) => {
	// return http.get('/repair/maintain/elevator/list', data);
	return http.request({
		url: '/repair/maintain/elevator/list',
		method: 'get',
		data
	});
};

// 获取我的项目电梯（组长调用）
export const getElevatorListGroup = (data) => {
	// return http.get('/repair/maintain/plan/content/distribution/elevator/select/child', data);
	return http.request({
		url: '/repair/maintain/plan/content/distribution/elevator/select/child',
		method: 'get',
		data
	});
};
// 获取我维保过的（组长调用）
export const getElevatorGroup = (data) => {
	// return http.get('/repair/maintain/plan/content/distribution/elevator/select', data);
	return http.request({
		url: '/repair/maintain/plan/content/distribution/elevator/select',
		method: 'get',
		data
	});
};

// 电梯维保历史
export const getElevatorHistory = (data) => {
	// return http.get('/repair/maintain/plan/content/history/page', data);
	return http.request({
		url: '/repair/maintain/plan/content/history/page',
		method: 'get',
		data
	});
};
// 电梯统计
export const myElevatorStatistics = (data) => {
	// return http.post('/repair/building/myElevatorStatistics', data, true, 60000);
	return http.request({
		url: '/repair/building/myElevatorStatistics',
		method: 'post',
		data,
		textJson: true,
		toast: 60000
	});
};
// 获取报障现象集合
export const problemItem = (data) => {
	// return http.get('/repair/maintain/malfunction/work/problem/item', data);
	return http.request({
		url: '/repair/maintain/malfunction/work/problem/item',
		method: 'get',
		data
	});
};

// 获取电梯类型数组
export const getBuildingType = (data) => {
	// return http.get('/repair/building/getBuildingType', data);
	return http.request({
		url: '/repair/building/getBuildingType',
		method: 'get',
		data
	});
};
// 获取电梯品牌列表
export const getBrand = (data) => {
	// return http.get('/repair/building/getBrands', data);
	return http.request({
		url: '/repair/building/getBrands',
		method: 'get',
		data
	});
};

// 获取电梯任务列表
export const history = (data) => {
	// return http.post('/repairCheck/elevator/plan/history', data, 1);
	return http.request({
		url: '/repairCheck/elevator/plan/history',
		method: 'post',
		data,
		textJson: true,
	});
};

// ///////////////////报障新接口2022-05-16/////////////////////

// 组员报障获取审批人
export const getApproveUserData = (data) => {
	// return http.get('/blade-user/getApproveUserData', data);
	return http.request({
		url: '/blade-user/getApproveUserData',
		method: 'get',
		data
	});
};
// 报障内容
export const malfunctionWorkContent = (data) => {
	// return http.post('/repair/maintain/plan/content/malfunctionWorkSave', data, true);
	return http.request({
		url: '/repair/maintain/plan/content/malfunctionWorkSave',
		method: 'post',
		data,
		textJson: true,
	});
};
// 报障内容关联救援单-新
export const malfunctionWorkContentV2 = (data) => {
	return http.request({
		url: '/repair/maintain/malfunction/rescue/report/mal',
		method: 'post',
		data,
		textJson: true,
	});
};
// 修改报障信息
export const malfunctionEdit = (data) => {
	// return http.post('/repair/maintain/plan/content/malfunctionWorkUpdate/message', data, true);
	return http.request({
		url: '/repair/maintain/plan/content/malfunctionWorkUpdate/message',
		method: 'post',
		data,
		textJson: true,
	});
};

// 添加处理结果
export const submitWork = (data) => {
	// return http.post('/repair/maintain/malfunction/work/submit', data, true);
	return http.request({
		url: '/repair/maintain/malfunction/work/submit',
		method: 'post',
		data,
		textJson: true,
	});
};

// 删除故障部件
export const removeWork = (data) => {
	// return http.del('/repair/maintain/malfunction/work/remove', data);
	return http.request({
		url: '/repair/maintain/malfunction/work/remove',
		method: 'DELETE',
		data,
	});
};

export const historyList = (data) => {
	// return http.get('/repairCheck/elevator/plan/history/all', data);
	return http.request({
		url: '/repairCheck/elevator/plan/history/all',
		method: 'get',
		data
	});
};

export const rescueHistoryList = (data) => {
	// return http.get('/repair/maintain/malfunction/rescue/history/page', data);
	return http.request({
		url: '/repair/maintain/malfunction/rescue/history/page',
		method: 'get',
		data
	});
};

// 获取设备品种

export const driveMode = (data) => {
	// return http.get('/repair/maintain/elevator/drive/mode', data);
	return http.request({
		url: '/repair/maintain/elevator/drive/mode',
		method: 'get',
		data
	});
};

//* ***************2023-02-10我的电梯改版第5次的接口****************

// 我的电梯-个人管理电梯-小区项目列表
export const getPersonalBuildingList = (data) => {
	// return http.post('/repair/building/personalBuildingList', data, true);
	return http.request({
		url: '/repair/building/personalBuildingList',
		method: 'post',
		data,
		textJson: true,
	});
};
// 我的电梯-部门管理电梯-小区项目列表
export const getDeptBuildingList = (data) => {
	// return http.post('/repair/building/deptBuildingList', data, true);
	return http.request({
		url: '/repair/building/deptBuildingList',
		method: 'post',
		data,
		textJson: true,
	});
};

// 我的电梯-个人管理电梯-小区项目电梯
export const getPersonalElevatorList = (data) => {
	// return http.post('/repair/building/personalElevatorList', data, true);
	return http.request({
		url: '/repair/building/personalElevatorList',
		method: 'post',
		data,
		textJson: true,
	});
};
// 我的电梯-部门管理电梯-小区项目电梯
export const getDeptElevatorList = (data) => {
	// return http.post('/repair/building/deptElevatorList', data, true);
	return http.request({
		url: '/repair/building/deptElevatorList',
		method: 'post',
		data,
		textJson: true,
	});
};
// 电梯统计
export const myElevatorStatisticsPlus = (data) => {
	// return http.post('/repair/building/principalBuildingStatistics', data, true, 60000);
	return http.request({
		url: '/repair/building/principalBuildingStatistics',
		method: 'post',
		data,
		textJson: true,
		toast: 60000
	});
};

//* ***************2023-04-8我的电梯改版第6次的接口****************
// 报障入口 项目列表
export const myMaintainBuilding = (data) => {
	// return http.post('/repair/building/myMaintainBuilding/list', data, true);
	return http.request({
		url: '/repair/building/myMaintainBuilding/list',
		method: 'post',
		data,
		textJson: true,
	});
};
// 报障入口 电梯列表
export const myMaintainBuildingChilds = (data) => {
	// return http.get('/repair/maintain/elevator/be/list', data);
	return http.request({
		url: '/repair/maintain/elevator/be/list',
		method: 'get',
		data
	});
};

// 更新审批状态选择
export const updateWork = (data) => {
	// return http.post('/repair/maintain/malfunction/work/update', data, true);
	return http.request({
		url: '/repair/maintain/malfunction/work/update',
		method: 'post',
		data,
		textJson: true,
	});
};

// 获取发起整改的数据内容填充
export const getReform = (data) => {
	// return http.get('/repair/maintain/malfunction/history/detail/v2', data);
	return http.request({
		url: '/repair/maintain/malfunction/history/detail/v2',
		method: 'get',
		data
	});
};

//* ***************2024-04-8我的电梯改版第n次的接口****************

// 删除维修结果
export const getRemoveResult = (data) => {
	// return http.get('/repair/maintain/malfunction/work/remove/result', data);
	return http.request({
		url: '/repair/maintain/malfunction/work/remove/result',
		method: 'get',
		data
	});
};

// 电梯档案 保险公司列表
export const insurance = (data) => {
	// return http.get('/repair/insurance/page', data);
	return http.request({
		url: '/repair/insurance/page',
		method: 'get',
		data
	});
};
